<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('服务器添加')" />
</head>
<body>
	<section class="content">
		<form class="form-horizontal" id="newsServerForm">
           <div class="box-body">
               <div class="form-group">
                   <label for="host" class="col-sm-3 control-label">服务器host :</label>
                   <div class="col-sm-4">
                       <input type="text" class="form-control" name="host" id="host" required  placeholder="请输入host">
                   </div>
                   <label for="port" class="col-sm-2 control-label">端  口 :</label>
                   <div class="col-sm-2">
                       <input type="text" class="form-control" name="port" id="port" required  placeholder="请输入端口">
                   </div>
               </div>
               <div class="form-group">
                   <label for="username" class="col-sm-3 control-label">用 户 名 :</label>
                   <div class="col-sm-8">
                       <input type="text" class="form-control" name="username" id="username" required  placeholder="请输入用户名">
                   </div>
               </div>
               <div class="form-group">
                   <label for="password" class="col-sm-3 control-label">密   码 :</label>
                   <div class="col-sm-8">
                       <input type="text" class="form-control" name="password" id="password" required  placeholder="请输入密码">
                   </div>
               </div>
               <div class="form-group">
                   <label for="passsalt" class="col-sm-3 control-label">混淆密码 :</label>
                   <div class="col-sm-8">
                       <input type="text" class="form-control" name="passsalt" id="passsalt" required  placeholder="请输入密码">
                   </div>
               </div>
           </div>
       </form>
	</section>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		function submitHandler() {
			if($("#newsServerForm").validate().form()){
                $.common.postAjax("/serverCon/doAdd",$("#newsServerForm").serialize(),function (data) {
                    if(data.code == 0){
                    	parent.layer.closeAll('iframe');
						parent.$.table.refreshTable();
						parent.toastr.success(data.msg);
					} else {
						parent.toastr.error(data.msg);
					}
                })
            }
		}
	</script>
</body>
</html>